package com.jzhao.gper.spring.v1.controller;

import com.jzhao.gper.spring.v1.annotation.JZAutowired;
import com.jzhao.gper.spring.v1.annotation.JZController;
import com.jzhao.gper.spring.v1.annotation.JZRequestMapping;
import com.jzhao.gper.spring.v1.service.DemoService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@JZController
@JZRequestMapping(value="/demo")
public class DemoController {

    @JZAutowired(value = "demoServiceImpl")
    private DemoService demoService;

    @JZRequestMapping(value = "/say")
    public void say (HttpServletRequest request, HttpServletResponse response){
        try {
            demoService.test();
            response.getWriter().write("你好");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
